package lifei.lifei.spring.pojo;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author 小李
 * @version 1.0
 * @date 2021/9/27 15:20
 */
@Data
//链式访问
@Component("user")
@Accessors(chain = true)
@PropertySource(value = "classpath:valueName.properties",encoding = "UTF-8")
public class User {
    //提供属性
    //@Value("小小")
    @Value("${config.name}")
    private String name;
    //@Value("18")
    @Value("${config.age}")
    private Integer age;
    public void sayHello(){
        System.out.println("轻轻的我走了，不带走一片云彩");
    }

}
